calculating variance with negative numbers